package com.wm.youfangtong.ui.launch

import android.app.Activity
import android.content.Intent
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wm.youfangtong.ui.activity.account.AccountActivity
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class LaunchViewModel : ViewModel() {

    /**
     * 跳转到账户页面
     */
    fun startActivity(activity: Activity) {
        viewModelScope.launch {
            delay(2000)
            val intent = Intent(activity, AccountActivity::class.java)
            activity.startActivity(intent)
            activity.finish()
        }
    }

}